package mode.singleton.ehs;

/**
 * 饿汉式单例模式
 *
 * @author xjx
 * @date 2023/7/17 15:42
 */
public class SingletonDemo {
    //私有实例，类初始化即加载
    private static SingletonDemo instance = new SingletonDemo();

    //构造方法私有化
    private SingletonDemo() {
    }

    //类的唯一出口
    public static SingletonDemo getInstance() {
        return instance;
    }
}
